#pragma once

#include <vector>
#include <list>
#include <map>
#include "log.h"

#define ENABLELOG

#define DllImport   __declspec( dllimport )
#define DllExport   __declspec( dllexport )

namespace System
{

	enum TypeEnum
	{
		Unused = 0,
		Generic,
		Graphics,
		Physics,
		AI,
		Animation,
		Input,
		Audio,
		Scripting
	};

	namespace Types
	{
		static const unsigned int Unused = 0;
		static const unsigned int Generic   = (1 << TypeEnum::Generic);
		static const unsigned int Graphics  = (1 << TypeEnum::Graphics);
		static const unsigned int Physics   = (1 << TypeEnum::Physics);
		static const unsigned int AI        = (1 << TypeEnum::AI);
		static const unsigned int Animation = (1 << TypeEnum::Animation);
		static const unsigned int Input     = (1 << TypeEnum::Input);
		static const unsigned int Audio     = (1 << TypeEnum::Audio);
		static const unsigned int Scripting = (1 << TypeEnum::Scripting);
		static const unsigned int All       = static_cast<unsigned int>(-1);
	}

	typedef unsigned int Type;
	
	namespace Names
	{
		static const wchar_t* Generic   = L"Generic";
		static const wchar_t* Graphics  = L"Graphics";
		static const wchar_t* Physics   = L"Physics";
		static const wchar_t* AI        = L"AI";
		static const wchar_t* Animation = L"Animation";
		static const wchar_t* Input     = L"Input";
		static const wchar_t* Audio     = L"Audio";
		static const wchar_t* Scripting = L"Scripting";
		static const wchar_t* All       = L"All";
	}
}

template<class T> 
void ReleaseCOM(T t)
{
	if(t)
	{
		t->Release();
		t = NULL;
	}
}



enum Error
{
	Success = 0,
	Out_of_range,
	Out_of_memory,
	IO_Error,
	Access_denied,
	Wrong_address,
	Not_found,
	Null_ptr,
	Init_failed,

	Error_Unknown,

};

typedef void* Handle;

typedef char i8;
typedef short i16;
typedef int i32;
typedef long long i64;

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;

typedef float f32;
typedef double f64;